home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / rsrcsrch.sit / Resource Searcher / stack_-1.xml < prev   
Extensible Markup Language  |  1991-03-01  |  5KB  |  20 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>1</cardCount>
  7.     <cardID>2821</cardID>
  8.     <listID>2239</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>ON closeSTACKput empty into field "Search Results"put empty into field "Search Messages"if the freesize of this stack > 4096 thenput "Compacting the Stack"domenu "Compact Stack"end ifEND CloseSTACKon SearchEngine ResourceType-- check the results fieldif field "Search Results" is not empty thenanswer "There are results reported already."&return&return&"What to do?" with "Cancel" or "Delete" or "Append"if it is "Cancel" then exit SearchEngineelse if it is "Delete" thenput empty into field "Search Results"put empty into field "Search Messages"else put return after field "Search Results"end if-- check the search textput field "Search Text" into SearchTextif SearchText is empty thenanswer "You did not provide a text string to search for."exit SearchEngineend if-- check the file type fieldput field "Search File Type" into SFtif SFt is empty thenanswer "You did not provide a file type to search"exit SearchEngineend if-- check the Where to Search fieldput field "Where to Search" into DiskListif DiskList is empty thenanswer "You did not prove a list of Volumes/Folders to search"exit SearchEngineend if-- put the intro messagesSearchMessage "*******************************"SearchMessage "Searching for '"&searchText&"' in resource type '"&ResourceType&"'."SearchMessage "Getting The List Of Files of type '"&field "Search File Type"&"'."put "*******************************"&return after field "Search Results"put "Searching for '"&searchText&"' in resource type '"&ResourceType&"'."&return after field "Search Results"-- start the search for each volume/folder specifiedrepeat with d=1 to the number of lines in DiskListset cursor to busyput empty into FLput line d of diskList into DPath-- get the list of files and folders in DPathSearchmessage "Checking All Files on Volume - '"&DPath&"'."put folderContents(Dpath,"Files") into FLput folderContents(Dpath,"Folders") after FLif FL is empty then next repeatrepeat with i=1 to the number of lines in FLput DPath before line i of FLend repeatsearchmessage "Checking Folders on Volume - '"&DPath&"'."put DPath into StartPathput 0 into fNumrepeat foreveradd 1 to FNumset cursor to busyput line FNum of FL into inrecif inrec is not empty then-- Do we have a folder or a fileif the last char of inrec is ":" then-- We have a folder so...-- get the list of files and folders and add them to the listsearchmessage "  "&inrecput folderContents(inrec,"Files") into folput folderContents(inrec,"folders") after folrepeat with i=1 to the number of lines in folput inrec before line i of folend repeatput fol after line FNum of FLelse-- We have a file so check it-- if the file fits the criteria then report itCheckFile SearchText,Sft,inrec,ResourceTypeend ifend ifif FNum >= the number of lines in FL then exit repeatend repeatend repeatput empty into FLend SearchEngineon SearchMessage msgif (the length of field "Search Messages")>29000 thenput "Due to size restrictions. Deleteting half of the messages"delete line 1 to ((the number of lines in field "Search Messages")/2) of field "Search Messages"else if visible of message thenput emptyhide messageend ifput msg&return after field "Search Messages"put (the number of lines in field "Search Messages")-4 into Lif L>0then set the scroll of field "Search Messages" to L*the textheight of field "Search Messages"end SearchMessageon CheckFile SearchText,SFT,cfile,ResourceTypeset cursor to busy-- check the filetypeif filetype(cfile) = SFT then-- its the right filetype-- check the resourcesput Resources(ResourceType,CFile) into ResourceListif ResourceList is not empty then-- it has the correct resource type-- check the namesput Search(ResourceList,SearchText,"False","All") into sAllif sAll is not empty then-- there are names that match-- report the resource namesput CFile&return after field "Search Results"repeat with s1=1 to the number of lines in sAllset cursor to busyput item 1 of line s1 of sAll into kput "  '" & (line k of ResourceList) &"'"&  Return after Field "Search Results"end repeat-- Check the scroll of the result fieldput (the number of lines in field "Search Results")-12 into sif s>0then set the scroll of field "Search Results" to s*(the textheight of  field "Search Results")end ifend ifend ifend CheckFile</script>
  17.     <background id="2722" file="background_2722.xml" name="" />
  18.     <card id="2821" file="card_2821.xml" marked="false" name="" owner="2722" />
  19. </stack>
  20.